package util;

import javax.servlet.http.Cookie;
import javax.servlet.http.HttpServletRequest;
import java.util.HashMap;
import java.util.Map;

public class CookieReader {
    private Map<String,String> cookieMap = new HashMap<>();
    public CookieReader(HttpServletRequest req){
        Cookie[] cookies = req.getCookies();
        for (Cookie c:cookies) {
            cookieMap.put(c.getName(),c.getValue());
        }
    }


    public String get(String name){
        return cookieMap.get(name);
    }
}
